package com.ysqcould.content.service.impl;


import com.ysqcould.common.utils.DateUtils;
import com.ysqcould.content.domain.SlideShow;
import com.ysqcould.content.mapper.SlideShowMapper;
import com.ysqcould.content.service.ISlideShowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 轮播图Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-06-28
 */
@Service
public class SlideShowServiceImpl implements ISlideShowService
{
    @Autowired
    private SlideShowMapper tSlideShowMapper;

    /**
     * 查询轮播图
     * 
     * @param id 轮播图主键
     * @return 轮播图
     */
    @Override
    public SlideShow selectTSlideShowById(Long id)
    {
        return tSlideShowMapper.selectTSlideShowById(id);
    }

    /**
     * 查询轮播图列表
     * 
     * @param tSlideShow 轮播图
     * @return 轮播图
     */
    @Override
    public List<SlideShow> selectTSlideShowList(SlideShow tSlideShow)
    {
        return tSlideShowMapper.selectTSlideShowList(tSlideShow);
    }

    /**
     * 新增轮播图
     * 
     * @param tSlideShow 轮播图
     * @return 结果
     */
    @Override
    public int insertTSlideShow(SlideShow tSlideShow)
    {
        tSlideShow.setCreateTime(DateUtils.getNowDate());
        return tSlideShowMapper.insertTSlideShow(tSlideShow);
    }

    /**
     * 修改轮播图
     * 
     * @param tSlideShow 轮播图
     * @return 结果
     */
    @Override
    public int updateTSlideShow(SlideShow tSlideShow)
    {
        tSlideShow.setUpdateTime(DateUtils.getNowDate());
        return tSlideShowMapper.updateTSlideShow(tSlideShow);
    }

    /**
     * 批量删除轮播图
     * 
     * @param ids 需要删除的轮播图主键
     * @return 结果
     */
    @Override
    public int deleteTSlideShowByIds(Long[] ids)
    {
        return tSlideShowMapper.deleteTSlideShowByIds(ids);
    }

    /**
     * 删除轮播图信息
     * 
     * @param id 轮播图主键
     * @return 结果
     */
    @Override
    public int deleteTSlideShowById(Long id)
    {
        return tSlideShowMapper.deleteTSlideShowById(id);
    }
}
